package com.baymax.test.scene.internal

import android.graphics.Rect
import android.graphics.RectF
import kotlin.properties.Delegates
import kotlin.reflect.KProperty

/**
 * @title:       标题
 * @project:     TestScene
 * @package:     com.baymax.test.scene.internal
 * @class:       Style
 * @description:
 * <p>
 * 类描述
 * </p>
 *
 * @version:   1.0
 * @createDate:   2023/2/1 15:44
 * @Copyright (C) 2023 YSTEN
 * @author:       xuyujian
 */
data class Style(
    @JvmField val left: Int,
    @JvmField val top: Int,
    @JvmField val width: Int,
    @JvmField val height: Int,
    @JvmField val right: Int = left + width,
    @JvmField val bottom: Int = top + height,
    @JvmField var renderLeft: Int = left,
    @JvmField var renderTop: Int = top,
    @JvmField var renderWidth: Int = width,
    @JvmField var renderHeight: Int = height,
) {

    val renderRight
        get() = renderLeft + renderWidth
    val renderBottom
        get() = renderTop + renderHeight

    fun fitRect(rect: RectF) {
        rect.set(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat())
    }

    companion object {
        @JvmField
        val EmptyWrap = Style(0, 0, 0, 0)
    }
}

